Skip to content

PoC: malicious KOS receiver recovers the shared delta - #1

Draft
AdamDawidKrol wants to merge 1 commit into
adam/mpz-alpha6-basefrom
adam/kos-domain-sep-attack-test
Draft

PoC: malicious KOS receiver recovers the shared delta#1
AdamDawidKrol wants to merge 1 commit into
adam/mpz-alpha6-basefrom
adam/kos-domain-sep-attack-test

Conversation

@AdamDawidKrol

@AdamDawidKrol AdamDawidKrol commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Reproduces the attack @sinui0 described in review of tlsnotary/tlsn#1173, as a single test against stock KOS (no protocol changes).

A malicious receiver runs two KOS extensions under the same global delta and reuses the same base OT. KOS has no per-instance domain separation, so both runs derive identical extension columns; only the receiver's internal choice bits differ. The sender's correlated keys are raw (key_j = t_j ^ choice_j·delta), so at any column where the two runs chose differently, key_a ^ key_b == delta.

The test asserts the recovered value equals delta — the leak is real.

Fix (per-instance salt / domain separation): #2.

Demonstrates the attack from review of tlsnotary/tlsn#1173: a malicious KOS
receiver runs two extensions under the same global `delta` and reuses the same
base OT. With no per-instance domain separation the two runs derive identical
extension columns, so at any column where the receiver's internal choice bits
differ, XOR-ing the sender's (raw, correlated) keys yields `delta` exactly.

Test only; no protocol change. Runs against stock KOS.
@AdamDawidKrol AdamDawidKrol reopened this Jul 23, 2026
@AdamDawidKrol
AdamDawidKrol force-pushed the adam/kos-domain-sep-attack-test branch from 77658c4 to 62337d8 Compare July 23, 2026 10:12
@AdamDawidKrol AdamDawidKrol changed the title [red] KOS domain separation is bypassable — failing security test PoC: malicious KOS receiver recovers the shared delta Jul 23, 2026
@AdamDawidKrol
AdamDawidKrol changed the base branch from adam/kos-domain-separation to adam/mpz-alpha6-base July 23, 2026 10:12
AdamDawidKrol added a commit that referenced this pull request Jul 23, 2026
Add an `instance_id` salt to `kos::Sender`/`Receiver`, mixed into the
base-OT-derived setup PRG seeds via a tweakable correlation-robust hash
(`FIXED_KEY_AES.tccr(instance_id, seed)`). Two KOS instances that share one
global `delta` and the same base OT then produce independent extension
transcripts, so per-instance consistency-check leakage can no longer be
composed to sample or recover `delta` (demonstrated in #1).

The mix is non-invertible in `seed` on purpose: a linear XOR mix
(`seed ^ instance_id`) would let a malicious receiver, who controls the
base-OT seeds, pre-compensate them to cancel the salt and collapse two
instances onto one PRG stream.

API-breaking: `Sender::new`/`Receiver::new` gain an `instance_id: Block`.
Paired sender and receiver must use the same id; distinct instances reusing
one `delta` must use distinct ids.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant